package com.sein.foods;

import java.util.ArrayList;
import java.util.List;

import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class CheckData extends ListActivity {
	TextView selection;
	public int idToModify;
	SQLHandler dm;
	List<String[]> list = new ArrayList<String[]>();
	List<String[]> names2 = null;
	String[] stg1;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.check);
		dm = new SQLHandler(this);
		names2 = dm.select("SELECT * FROM performance", null);
		stg1 = new String[names2.size()];
		int x = 0;
		String stg;
		for(String[] name : names2){
			stg = name[1] + " - "+name[2] + " - "+ name[3] + " - "+ name[4];
			stg1[x] = stg;
			x++;
		}
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, stg1);
		this.setListAdapter(adapter);
		selection = (TextView)findViewById(R.id.selection);
		
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		selection.setText(stg1[position]);
	}
}
